package com.wwj.feedback.exception;

import com.wwj.common.constant.CommonCodeEnum;
import com.wwj.common.entitiy.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class BaseException {
    @ExceptionHandler({ OpenFeignException.class })
    public R<Object> openFeignExceptionHandler(Exception e){
        log.error("远程调用发生异常");
        return R.error(CommonCodeEnum.RTC_ERROR.getCode(), CommonCodeEnum.RTC_ERROR.getMsg());
    }
}
